package cc.catface.commom.context;

import android.widget.Toast;


/**
 * Created by catfaceWYH --> tel|wechat|qq 130 128 92925
 */
public class TToast {

    private static Toast mToast;


    public static void show(String msg) {
        show(msg, Toast.LENGTH_SHORT);
    }

    public static void show(int stringId) {
        show(TApp.getInstance().getResources().getString(stringId), Toast.LENGTH_SHORT);
    }


    public static void show(CharSequence charSequence, int duration) {
        if (null != mToast) {
            mToast.setText(charSequence);
            mToast.setDuration(duration);
            mToast.show();
            return;
        }

        mToast = Toast.makeText(TApp.getInstance(), charSequence, duration);
        mToast.show();
    }

}
